package com.design.model.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: study
 * @className: Watter
 * @description: TODO
 * @author: kukuxiahuni
 * @create: 2019-06-30 21:03
 * @version: v1.0
 **/
public class Watter {

    private List<Command> commandList = new ArrayList<>();

    /**
     * 功能描述: TODO
     *
     * @param:
     * @return:
     * @auther: kukuxiahuni
     * @date: 2019/6/30 9:03 PM
     * @modify_auther: kukuxiahuni
     * @modify_time: 2019/6/30 9:03 PM
     **/
    public void setOrder(Command command) {
        this.commandList.add(command);
    }

    /**
     * 功能描述: 通知执行
     *
     * @param:
     * @return:
     * @auther: kukuxiahuni
     * @date: 2019/6/30 9:04 PM
     * @modify_auther: kukuxiahuni
     * @modify_time: 2019/6/30 9:04 PM
     **/
    public void notifyExec() {
        this.commandList.forEach( e -> e.execute());
    }
}
